<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<jsp:include page="/common/jsp/adminHeader.jsp" flush="true"/>
<jsp:include page="/common/jsp/adminNav.jsp" flush="true"/>

<!--For Commons Validator Client Side-->
<script type="text/javascript" src="<c:url value='/validator.do'/>"></script>
<validator:javascript formName="goodscateVO" staticJavascript="false" xhtml="true" cdata="false"/>

<script type="text/javaScript" charset="UTF-8" defer="defer">
//<![CDATA[
	$(document).ready(function() {
		window.fn_submitForm = function(frm) {
			if(!validateGoodscateVO(frm))
				return false;
			else 
				frm.action = "<c:url value='/ADMIN/GoodsCateInsert.do'/>";
		};
	});
//]]>
</script>

<link rel="stylesheet" href="/common/css/03goods.css" />
		<form:form commandName="goodscateVO" name="frm" onsubmit="return fn_submitForm(this);" method="post">
			<input type="text" name="depth" value="${goodsVO.depth}"/>
			<section id="subpage_outer_wrap">
				<div class="subpage_inner_wrap">

					<div class="subpage_contents_inner_wrap drop_shadow">
						<div class="item_block">
							<div class="tab_1_wrap">
								<ul class="tab1_layout">
									<li class="tab1_li"><a class="tab1_btn" href="#tab1">시스템 관리</a></li>
									<li class="tab1_li"><a class="tab1_btn" href="/admin/02site/01_01.jsp">사이트 관리</a></li>
									<li class="tab1_li"><a class="tab1_btn tab_btn_selected" href="/admin/03prod/01_01.jsp">상품관리</a></li>
									<li class="tab1_li"><a class="tab1_btn" href="/admin/04statistic/01_01.jsp">주문/정산/통계 관리</a></li>
									<li class="tab1_li"><a class="tab1_btn" href="/admin/05equip/01_01.jsp">장비/신청 관리</a></li>
								</ul>
							</div>
						</div>
						<div class="item_block">
							<div class="path_wrap">
								<img class="path_bullet_home" src="/images/adm_common/header_path_home.gif" alt=""/>
								상품관리<img class="path_bullet_arrow" src="/images/adm_common/header_path_arrow.gif" alt=""/>
								분류관리
							</div>
						</div>					
					</div>
								
					<div class="subpage_contents_wrap">
						<div class="subpage_contents_inner_wrap drop_shadow">
							<h1 class="h1_1">분류관리 관리</h1>
							<h2 class="h2_1">분류코드 등록</h2>
							<form>
								<table summary="" class="tb2">
									<colgroup>	
										<col width="25%" />
										<col width="*" />
									</colgroup>
									<thead></thead>
									<tbody>
<c:if test='${goodsVO.depth >= 2}'>
										<tr>
											<th scope="row">분류1</th>
											<td class="no_r_border">
												<form:select class="text_input01" path="gcaSn"> 
													<option value="">선택하세요</option>
	<c:forEach var="rs" items='${cate1List}' varStatus="status">
													<option value='${rs.gcaSn}' ${rs.gcaSn == gcaSn ? 'selected="selected"':''}>
														${rs.gcaName}
													</option>
	</c:forEach>
												</form:select>
											</td>
										</tr>
</c:if>
<c:if test='${goodsVO.depth >= 3}'>
										<tr>
											<th scope="row">분류2</th>
											<td class="no_r_border">
												 <select class="text_input01"> 
													<option>선택하세요</option> 
													<option>1-1그룹</option> 
													<option>2-1그룹</option> 
													<option>3-1그룹</option> 
												</select>
											</td>
										</tr>
</c:if>
										
<c:choose>
	<c:when test='${goodsVO.depth eq 2}'>
		<c:set var="useyn" value="gcbUseYn"/>
		<c:set var="catename" value="gcbName"/>
	</c:when>
	<c:when test='${goodsVO.depth eq 3}'>
		<c:set var="useyn" value="gccUseYn"/>
		<c:set var="catename" value="gccName"/>
	</c:when>
	<c:otherwise>
		<c:set var="useyn" value="gcaUseYn"/>
		<c:set var="catename" value="gcaName"/>
	</c:otherwise>
</c:choose>	
										<tr>
											<th scope="row">분류명</th>
											<td class="no_r_border"><form:input title="분류명을 입력하세요" class="text_input04" path="cateName"/></td>
										</tr>
										<tr>
											<th scope="row">사용유무</th>
											<td class="no_r_border">
												<input title="사용" name="${useyn}" id="use" type="radio" class="radio_input01" checked value="Y"/><label for="use">사용</label>
												&nbsp;&nbsp;
												<input title="중지" name="${useyn}" id="cancellation" type="radio" class="radio_input01" value="N"/><label for="cancellation">중지</label>
											</td>
										</tr>
									</tbody>
									<tfoot></tfoot>
								</table>
								<div class="table_btn_box2">
									<span>
										<input type="submit" value="저장" class="btn_01"/> 
									</span>
									<span>
										<input type="button" value="취소" class="btn_02"/> 
									</span>
								</div>
							</form>
						</div>						
					</div>
				</div>
			</section>
		</form:form>
<jsp:include page="/common/jsp/adminFooter.jsp" flush="true"/>